package com.dongdongshop.config;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118651884";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC2lRLRa6mkEV/gX4UkbxVxjimftESey05XWOWmXIkKP+86i6R6krs6gUErdC+TeF44Su1QgaGOLfo0O2LYs6m1Zx/rYEU/vp+qL7vkmSctVm7lLRPGlkDSD4MZmzcEI+HG20vsjpUy10NZb98K4G18cf379iGy33I2mceW/u592cERO2NEYmqAfxObWbgye1hkZoi38d5emc/ukGstzMgTFBpAiglikjkxHaabRyNC+9rjdExmwXiZq/7ebzq+yJdCI3mwl6LHDdlWmyvXeCks4JtFkjXVFH3q8LPPQNsihFKVTJFoIvQlbcG5vUIEwcmyHkNbBekEkxq06lho7tGLAgMBAAECggEAAlfNYwSXq7RRX6a6JaqLQubJH/SHQOZo/fP1Fnpvg8MoRb8PAEerwWdxN6aJCcJsqxpDC1pugU2TvWHZteAwWFSXc0TL/rJqiBuOtLNGbm2ChMxcSZsZ/9gVHZoBTbtMJWohAkseHQXoJliqKxCQNx2bXcVdz1bQt2SnzAc/djv0h5VUgSk6YiHYYh47SGk5L6cmaitPaDvyTN4MBF/Dm/piVA8Ye+/XrTeWdm4KKcQyuIokxKpfl6PWEE3VqrymWjAbu1ANlCp3T9iSLVklEG6PvNnmwVBXBxUj89iu1g9wN6OgBArAmrI7CBCjMVX3Fo9u64kdbtOqTrLmUddhAQKBgQD1J5v8KUrkUahwbmI6nFOB63nkrO3uVlUynykHAV5gK2M5xkNhpMWMA3WwVHNcd4df0e0yo+N0zFxigLnuXm7XR6/FN0YqfVEfOj9xMp6FR3wEys2NyGuBN1YI3X46+2hNe6nd+Av3S+Ap3NPIFlfthQEbFdOaXNUhPUv2HKYigQKBgQC+qNQJgXOXbI/cHAmh6zu/Ej1JPBuBXpwebqa919/zs/Hs0ropZ9wDnBKZbfEfbxyqVIlxLpThZpkPsNcYdFgzZSfvGEfDGoqo+CugfXwQZCMXHW1p4u2tbdhzPkaG9zwzplDsKFJ0CbLQFj1pgHorKP97/Vj5vti4hPMAXDRWCwKBgH+iB4vY06za9p7SWUG6cZ+KQQPVJGqZd/HK+0kyZTgcXqSNnDcR2edzRapvzT+u20P/v0ZGHP2KB+8gpax8baiXIePDSzyD0eA4Kx98AxvQg7ja/Pl8BrxXWutypW1/xmXQpDd0FIbDcglZdskNGOoH/PNlAa2z9yI/D3UqpTQBAoGAJbwuc08uvJqdAnh+I5D2O0P140fFPd6m0ZMe51YRmh9UU4YFmGpY7lH2kG1lGs6YAtJGfaM1jkMLKkLa35kvV8S+maDZmzDmnri3kcUkR+45z7pgTGPAnOGvxGdf+Bh4ztQtEgCNCTBeNrcgIoBuLZqorjafZJa0OBkAK2MUbK8CgYBnXSTf5ppwjL1bK9l0XItufymEEufxxJD8aIvOQgs+hedJp5UsKrHzoBb468sEsffsruIySDnZwYagnWqNjaVURoEwXnOUdIdXq8ulcXo2654nGq8HYow1toi46il+WuJi4+SvctcghUIMvYg9oqNZ4Ct1RfCfpWYzbPWWKWzwoQ==\n";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlp3nQPX7q1IFyL2FHsffS1HEyhtSHq+1A2i7MTnlcx3Q9QHqkooZhkWDnds2PjPXYsNidZyoV5CVve/skeQ+4Ll+0yIyxG9kmg91bKXKKsrkWYv+x6CaGuwpZ1b6MxTGkTqwNRBAoU8UYaFyh8jWpDJDFqc6FKc+x3j4AAZkXreHOADyxugx4NjunY41UXnQbOyKYTjS5di6jQmlbqmKD4sKs0ui5Olk8HP/LG1nxs/YK/Blw20L8rwE1Q4T+up1lChjwgo4aFPazRfMJitJFeBlimu+2mGz35yNa906AJwTIISq2nQ/CYrlgxUEC4e1VoOQQdufPdYq+mBCjBfGGQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://45h658k159.zicp.vip/alipayCallback/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://45h658k159.zicp.vip/alipayCallback/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志打印路径
    public static String log_path = "E:\\logs\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}